﻿using System;

namespace CSW.Framework.Common.Utils
{
    /// <summary>
    /// TimeStamp.
    /// </summary>
    public class TimeStamp
    {
        /// <summary>
        /// Returns current time stamp in format yyyyMMdd_HHmmss.
        /// </summary>
        /// <returns>The current time stamp in format yyyyMMdd_HHmmss.</returns>
        public static string GetCurrent()
        {
            return DateTime.Now.ToString("yyyyMMdd_HHmmss");
        }

        /// <summary>
        /// Returns current time stamp in the specified format.
        /// </summary>
        /// <param name="format">A <see cref="DateTime"/> format string.</param>
        /// <returns>The current time stamp in the specified format.</returns>
        public static string GetCurrent(string format)
        {
            return DateTime.Now.ToString(format);
        }
    }
}
